package com.yanqu.road.server.cmd.activity.relation;

import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.cross.activity.CrossActivityProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.protocol.Protocol;

@Cmd(code = Protocol.S_COOK_BOY_ACTIVITY_SERVER_RANK, desc = "冲榜排行榜")
public class RelationActivityServerRankListCmd extends AbstractCommand {

    private int activityId;

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        CrossActivityProto.CrossActivityServerRankListReqMsg reqMsg = CrossActivityProto.CrossActivityServerRankListReqMsg.parseFrom(packet.getBytes());
        activityId = reqMsg.getActivityId();
        return true;
    }

    @Override
    public void execute(GamePlayer player, YanQuMessage packet) throws Exception {

    }

    @Override
    public void sendData(GamePlayer player) {
        CrossActivityProto.CrossActivityServerRankListReqMsg.Builder msg = CrossActivityProto.CrossActivityServerRankListReqMsg.newBuilder();
        msg.setActivityId(activityId);
        player.sendPacket(Protocol.C2_CROSS_GET_RELATION_ACTIVITY_SERVER_RANK, msg);
    }

}
